@extends('admin_system/public/layout')
@section('content')
    <div style="width: 80%;margin: 0 auto;background: silver;height: 50px;display: flex;justify-content: space-around">
        <button class="btn btn-info dingyue">订阅连接管理</button>
        <button class="btn btn-info share">分享连接管理</button>
    </div>

    <div id="dingyue"
         style="width: 80%;margin: 10px auto;display: block;justify-content: space-between;flex-direction: row;align-items: center;flex-wrap: wrap">

        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
            <div class="thumbnail">
                <img data-src="3" alt="">
                <div class="caption">
                    <p style="font-size: 77px;text-align: center">
                        <a href="/admin_system/share/add_link/1" style="text-decoration: none">+</a>
                    </p>
                </div>
            </div>
        </div>

        @foreach($dingyue as $k=>$v)
            <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
                <div class="thumbnail">
                    <img data-src="3" alt="">
                    <div class="caption">
                        <h3>{{substr($v->live_title,0,30)}}</h3>
                        <p>
                            {{substr($v->description,0,30)}}...
                        </p>
                        <p>
                            <a href="/admin_system/live/link/eidt/{{$v->link_type}}/{{$v->id}}"
                               class="btn btn-primary">编辑</a>
                            &nbsp;
                            {{--<a href="/admin_system/live/link/del/{{$v->id}}"--}}
                               {{--class="btn btn-primary">删除</a>--}}
                        </p>
                    </div>
                </div>
            </div>
        @endforeach
    </div>

    <div id="share"
         style="width: 80%;margin: 10px auto;display: flex;justify-content: space-between;flex-direction: row;align-items: center;flex-wrap: wrap;display: none">

        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
            <div class="thumbnail">
                <img data-src="3" alt="">
                <div class="caption">
                    <p style="font-size: 77px;text-align: center">
                        <a href="/admin_system/share/add_link/2" style="text-decoration: none">+</a>
                    </p>
                </div>
            </div>
        </div>

        @foreach($share as $k=>$v)
            <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
                <div class="thumbnail">
                    <img data-src="3" alt="">
                    <div class="caption">
                        <h3>{{substr($v->title,0,30)}}</h3>
                        <p>
                            {{substr($v->description,0,30)}}...
                        </p>
                        <p>
                            <a href="/admin_system/live/link/eidt/{{$v->link_type}}/{{$v->id}}"
                               class="btn btn-primary">编辑</a>
                            &nbsp;
                            {{--<a href="/admin_system/live/link/del/{{$v->id}}"--}}
                               {{--class="btn btn-primary">删除</a>--}}
                        </p>
                    </div>
                </div>
            </div>
        @endforeach
    </div>


    <script>
        var dingyue = document.querySelector('.dingyue');
        var share = document.querySelector('.share');
        var dingyue_id = document.getElementById('dingyue');
        var share_id = document.getElementById('share');

        dingyue.onclick = function () {
            dingyue_id.style.display = '';
            share_id.style.display = 'none';
        };
        share.onclick = function () {
            share_id.style.display = '';
            dingyue_id.style.display = 'none'
        }
    </script>


@endsection